import request from "@/utils/request";

export const getAllStores = () => {
  return request.get("/costumes/getAllStores");
};

export const addStore = (data: any) => {
  return request.post("/costumes/addStore", data);
};

export const updateStore = (data: any) => {
  return request.put("/costumes/updateStore", data);
};

export const deleteStore = (id: string) => {
  return request.delete(`/costumes/deleteStore/${id}`);
};

// 获取门店员工信息
export const getStoreEmployees = (storeId: string) => {
  return request.get(`/userRole/getStore/${storeId}`);
};

// 添加员工
export const addEmployee = (data: any) => {
  return request.post("/userRole/addEmployee", data);
};

// 更新员工信息
export const updateEmployee = (data: any) => {
  return request.put("/userRole/updateEmployee", data);
};

// 删除员工
export const deleteEmployee = (id: string) => {
  return request.delete(`/userRole/deleteEmployee/${id}`);
};

// 获取门店服饰列表
export const getAllCostumes = (
  storeId: string,
  params: { pageNo: number; pageSize: number }
) => {
  return request.get(`/store/getAllCostumes/${storeId}`, { params });
};

// 更新服饰状态
export const updateCostume = (data: {
  id: string | number;
  status: number;
}) => {
  return request.post(`/store/costumes`, data);
};

// 新增服饰
export const addCostume = (data: {
  storeId: string | number;
  costumesId: string;
}) => {
  return request.post(`/store/costumes/add`, data);
};

// 获取所有服饰列表（用于选择）
export const getAllCostumesForSelect = (params: {
  pageNo: number;
  pageSize: number;
  name?: string;
  costumeId?: string;
}) => {
  return request.get(`/costumes/getAllCostumes`, { params });
};

// 删除服饰
export const deleteCostume = (id: string | number) => {
  return request.delete(`/store/${id}`);
};
